<template>
	<view class="mord">
		
		<view class="list" v-if="goods != null">
			<navigator :url="'/pages/detail/index?id='+pid" class="li">
				<view class="imgbox">
					<image :src="goods.fullDefaultImageUrl" mode="widthFix"></image>
				</view>
				<view class="text">
					<view class="h1">
						{{goods.cName}}
					</view>

					<view class="nav">
						￥{{goods.fSalePrice}}
						<view class="add">
							<image src="../../static/img/3/3-84.png" mode="widthFix"></image>
						</view>
					</view>
				</view>
			</navigator>

		</view>
		<view class="last">
			<view class="h2">
				<view class="mos">
					相似好货为你推荐
				</view>
			</view>
			<view class="cobox">

				<view class="guess-section">
					<navigator :url="'/pages/detail/index?id='+l.pid" class="guess-item" v-for="l in goodsList">
						<view class="image-wrapper">
							<image :src="l.defaultAlbum" mode="widthFix"></image>
						</view>
						<text class="title clamp">{{l.cProductShowName}}</text>
						<text class="price">
							￥{{l.fSalePrice}}
							<view class="ads">
								<image src="../../static/img/3/3-84.png" mode="widthFix"></image>
							</view>

						</text>
					</navigator>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		name: "",
		components: {

		},
		data() {
			return {
				num: 0,
				goodsList:[],
				goods:null,
				pid:null
			}
		},
		onLoad(options) {
			let that = this;
			this.pid=options.pid
		let datas = {
			queryCondition:{
			  //   order: [
					// {
					// fieldname:"iOrder", 
					// direction:this.order	
					// }
					
			  //   ],
			    pagesize: 20,
			    pageindex: 1,
			    where: [
			    { fieldname: "goods_id_exclude",valuefrom: options.pid},
			    { fieldname: "categoryid",valuefrom: options.productClass},
			    {  fieldname: "type", valuefrom: 1}
			    ],
			    }
		}
		this.$Request.post(this.$api.httpApi.home.getRecommendCartList+
		'&token='+this.$SysCache.get('token'),datas).then(res => {
			if (res.code == 200) {
					this.goodsList = res.data.data
				}
			})
			this.$Request.post(this.$api.httpApi.goods.iteminfo+
		'&token='+this.$SysCache.get('token'),{id:options.pid}).then(res => {
			if (res.code == 200) {
					this.goods = res.data
				}
			})
		},
		methods: {}


	}
</script>

<style scoped>
	.cobox {
		margin-top: 43rpx;
	}
	
	.guess-section {
		display: flex;
		flex-wrap: wrap;
		padding: 0 30rpx;
	
	
	}
	
	.guess-item {
		display: flex;
		flex-direction: column;
		width: 48%;
		padding-bottom: 29rpx;
		background: #fff;
		margin-bottom: 21rpx;
	
	}
	
	.guess-item:nth-child(2n+1) {
		margin-right: 4%;
	}
	
	.image-wrapper {
		width: 100%;
		height: 330rpx;
		border-radius: 3px;
		overflow: hidden;
		background: #fff;
		position: relative;
	}
	
	.image-wrapper image {
		width: 70%;
		opacity: 1;
		display: block;
		position: absolute;
		margin: auto;
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
	}
	
	.price {
		font-size: 26rpx;
		font-family: Adobe Heiti Std;
		font-weight: normal;
		color: rgba(240, 64, 111, 1);
		padding-left: 30rpx;
		padding-right: 30rpx;
		position: relative;
	
	
	}
	.price .ads{
		float: right;
		width: 33rpx;
	}
	.price .ads image{
		display: block;
		width: 100%;
	}
	.pay {
		font-size: 17rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
		text-decoration: line-through
	}
	
	.collect {
		position: absolute;
		right: 29rpx;
		bottom: 10rpx;
		width: 30rpx;
		height: 28rpx;
		z-index: 1;
	}
	
	.last {
		/* padding-top: 342rpx; */
	}
	
	.h2 {
		font-size: 30rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #6D6455;
		text-align: center;
	}
	
	.mos {
		display: inline-block;
		vertical-align: middle;
		margin-left: 15rpx;
		margin-right: 15rpx;
	}
	
	.h2 .b {
		display: inline-block;
		vertical-align: middle;
		height: 3rpx;
		background: rgba(132, 123, 108, 1);
		width: 68rpx;
	}
	
	.h2 text {
		color: #C2AE8D;
	}
	
	.but {
		width: 609rpx;
		height: 85rpx;
		background: rgba(255, 255, 255, 1);
		margin: auto;
		font-size: 30rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(183, 153, 103, 1);
		line-height: 85rpx;
		text-align: center;
		margin-top: 45rpx;
	}
	
	.both {
		display: block;
		clear: both;
	}
	.text {
		width: calc(100% - 225rpx - 25rpx);
		display: inline-block;
		vertical-align: middle;
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(77, 77, 77, 1);
	}
	.guess-item .title {
		font-size: 23rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #444444;
		line-height: 35rpx;
		padding-left: 30rpx;
		padding-right: 30rpx;
		z-index: 10;
	}
	.p {
		font-size: 22rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(240, 64, 111, 1);
		margin-top: 18rpx;
	}

	.p text {
		font-size: 30rpx;
		margin-right: 12rpx;
	}

	.nav {
		margin-top: 25rpx;
		font-size: 28rpx;
		color: rgba(240, 64, 111, 1);
	}



	.nav .add {
		display: inline-block;
		float: right;
		width: 33rpx;
		margin-top: 5rpx;
	}

	.nav .add image {
		display: block;
		width: 100%;

	}

	.list {
		width: 90%;
		margin: auto;
		padding-top: 30rpx
	}

	.list .li {
		background: #fff;
		padding: 30rpx;
		margin-bottom: 20rpx;
	}

	.imgbox {
		width: 225rpx;
		display: inline-block;
		vertical-align: middle;
		margin-right: 25rpx;
	}

	.imgbox image {
		max-width: 197rpx;
	}

	.top {
		height: 62rpx;
		background: #040000;
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: rgba(231, 231, 231, 1);
		text-align: center;
		display: flex;
		line-height: 62rpx;
	}

	.top navigator {
		flex: 1;
		margin-left: 90rpx;
		margin-right: 90rpx;
	}

	.active {
		border-bottom: 3rpx solid #F0406F;
		color: #F0406F;
	}

	uni-page-body {
		height: 100%;
	}

	.mord {
		min-height: 100%;
		background: #EEEEEE;
	}
</style>
